import { MIMEParams } from 'util'
import request from '../util/request.js'

const app = getApp()

const baseUrl = app.globalData.requestUrl

/*********
@@param {传参} 
data=> post
 param=>get
	
***********/

//获取配置
export function getConfig(data) {
  return request({
    url: baseUrl+"/wap/login/getConfig",
    method: 'GET',
    data
  })
}


/**********登录接口**********/ 
export function managerLogin(data) {
  return request({
    url: baseUrl+"/wap/login/check",
    method: 'POST',
    data
  })
}

//微信登录获取密钥

export function getCode(data) {
  return request({
    url: baseUrl+"/wap/Login/getCode",
    method: 'GET',
    data
  })
}


export function wechatLogin(data) {
  return request({
    url: baseUrl+"/wap/Login/wechatLogin",
    method: 'GET',
    data
  })
}

export function memberShip(data) {
  return request({
    url: baseUrl+"/wap/product/memberShip",
    method: 'POST',
    data
  })
}

// 获取评论列表
export function comment_list(data) {
  return request({
    url: baseUrl+"/wap/product/comment_list",
    method: 'GET',
    data
  })
}
// 获取错题库列表
export function userWrongBank(data) {
  return request({
    url: baseUrl+"/wap/topic/userWrongBank",
    method: 'POST',
    data
  })
}
// 获取试题列表
export function practiceList(data) {
  return request({
    url: baseUrl+"/wap/topic/practiceList",
    method: 'POST',
    data
  })
}
// 获取试题详细简介
export function testPaperDetails(data) {
  return request({
    url: baseUrl+"/wap/topic/testPaperDetails",
    method: 'POST',
    data
  })
}
//开始答题
export function userAnswer(data) {
  return request({
    url: baseUrl+"/wap/topic/userAnswer",
    method: 'GET',
    data
  })
}


//获取试卷试题
export function testPaperQuestions(data) {
  return request({
    url: baseUrl+"/wap/topic/testPaperQuestions",
    method: 'GET',
    data
  })
}
//答题
export function submitQuestions(data) {
  return request({
    url: baseUrl+"/wap/topic/submitQuestions",
    method: 'POST',
    data
  })
}

//获取答题卡信息
export function answerSheet(data) {
  return request({
    url: baseUrl+"/wap/topic/answerSheet",
    method: 'POST',
    data
  })
}

//提交试卷
export function submitTestPaper(data) {
  return request({
    url: baseUrl+"/wap/topic/submitTestPaper",
    method: 'POST',
    data
  })
}

export function examinationResults(data) {
  return request({
    url: baseUrl+"/wap/topic/examinationResults",
    method: 'POST',
    data
  })
}


// 获取会员信息
export function memberInfo(data) {
  return request({
    url: baseUrl+"/wap/my/member",
    method: 'POST',
    data
  })
}
//下单购买会员
export function buyOrder(data) {
  return request({
    url: baseUrl+"/wap/special/buy_order",
    method: 'GET',
    data
  })
}


//分销首页

export function spreadIndex(data) {
  return request({
    url: baseUrl+"/wap/spread/spread_index",
    method: 'GET',
    data
  })
}

export function spreadlist(data) {
  return request({
    url: baseUrl+"/wap/spread/spread_list",
    method: 'POST',
    data
  })
}
export function withDraw(data) {
  return request({
    url: baseUrl+"/wap/spread/update_withdraw",
    method: 'POST',
    data
  })
}

export function addComment(data) {
  return request({
    url: baseUrl+"/wap/product/add_comment",
    method: 'POST',
    data
  })
}
export function getSpreadList(data) {
  return request({
    url: baseUrl+"/wap/spread/get_spread_list",
    method: 'GET',
    data
  })
}
export function getWithdrawalList(data) {
  return request({
    url: baseUrl+"/wap/spread/get_withdrawal_list",
    method: 'GET',
    data
  })
}

/**************/


/*********仿真*********/
export function fzAnswer(data) {
  return request({
    url: baseUrl+"/wap/topic/fzAnswer",
    method: 'POST',
    data
  })
}

export function fzQuestion(data) {
  return request({
    url: baseUrl+"/wap/topic/fzQuestion",
    method: 'POST',
    data
  })
}
export function upFzAnswer (data){
	return request({
	  url: baseUrl+"/wap/topic/upFzAnswer",
	  method: 'POST',
	  data
	})
}

export function orderList (data){
	return request({
	  url: baseUrl+"/wap/special/order_list",
	  method: 'POST',
	  data
	})
}

export function submitWrongBank (data){
	return request({
	  url: baseUrl+"/wap/topic/submitWrongBank",
	  method: 'GET',
	  data
	})
}

export const uploadFile = baseUrl + '/commonClient/file/uploadFile'
